package com.carstop.model;

import java.util.List;

public class TownService {

	private TownDAO_interface dao;

	public TownService() {
		dao = new TownDAO();
	}

	public TownVO addArea(String town_id, String name, String city_id) {

		TownVO townVO = new TownVO();

		townVO.setTown_id(town_id);
		townVO.setName(name);
		townVO.setCity_id(city_id);
		dao.insert(townVO);

		return townVO;
	}

	public TownVO updateEmp(String town_id, String name, String city_id) {

		TownVO townVO = new TownVO();

		townVO.setTown_id(town_id);
		townVO.setName(name);
		townVO.setCity_id(city_id);
		dao.update(townVO);

		return townVO;
	}

	public void deleteEmp(String area_id) {
		dao.delete(area_id);
	}

	public List<TownVO> getAll() {
		return dao.getAll();
	}
}
